package inflection;

import java.lang.reflect.Method;

public class MyTest01 {

    @MyTest
    public void test01(){
        System.out.println("===test01====");
    }
    public void test02(){
        System.out.println("===test02====");
    }
   @MyTest
    public void test03(){
        System.out.println("===test03====");
    }
    public void test04(){
        System.out.println("===test04====");
    }

    public static void main(String[] args) {
        MyTest01 myTest01 = new MyTest01();
        Class aClass = myTest01.getClass();
        Method[] methods = aClass.getDeclaredMethods();
        for (Method method : methods) {
            if(method.isAnnotationPresent(MyTest.class)){
                try {
                    method.invoke(myTest01);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }


        }
    }
}
